<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>LengKeng</title>
	<link rel="stylesheet" href="css/lucene.css" type="text/css" />
	<link rel="stylesheet" href="css/reset.css" type="text/css" />
	<script src="js/jquery-1.10.2.min.js"></script>

	<script src="js/lucene.js" />
	<script>
		$(document).ready(function() {
			paggin();
		});
		$(document).on('click', '.div-more', function() {
			if ($('.div-action-more').css('display') == 'none')
				$('.div-action-more').slideDown();
			else
				$('.div-action-more').slideUp();

		});
	</script>
	<style>
.search_form {
	float: left;
	margin-top: 10px;
}

.selected_page {
	color: #69AFFA !important;
}

body {
	background: #fff;
}

.page-element a {
	text-decoration: none;
	color: #000;
}

.logo {
	display: inline;
}

.ui-radiobutton {
	margin-left: 10px;
}

.logo img {
	float: left;
	margin-left: 10%;
	margin-right: 10px;
	width: 90px;
}
</style>
</h:head>
<h:body>
	<p:ajaxStatus
		style="bottom: 68%;
				    height: 32px;
				    position: fixed;
				    right: 50%;
				    width: 32px;
				    z-index: 99999;">
		<f:facet name="start">
			<p:graphicImage value="image/loading.gif" />
		</f:facet>

		<f:facet name="complete">
			<h:outputText value="" />
		</f:facet>
	</p:ajaxStatus>
	<div class="header">
		<div class="logo">
			<img style="cursor: pointer;"
				onclick="window.location.assign('main.xhtml')"
				src="image/logoadmin.png"></img>
		</div>
		<div class="search_form">
			<h:form>


				<h:inputText value="#{resultBean.textSearch}"
					styleClass="input-search"
					onkeypress="if (event.keyCode == 13)  $('.presss').trigger('click');">
				</h:inputText>

				<p:commandLink actionListener="#{resultBean.doSearch}" styleClass="presss"
					update=":main_page" oncomplete="paggin();"
					onclick="$('.div-action-more').slideUp();">
					<div class="div-search">
						<p:graphicImage value="image/515.png" />
					</div>
				</p:commandLink>
				<div class="div-more">
					<img title="Nâng cao" src="image/100.png"></img>
				</div>
				<div class="div-action-more">
					<div class="feild-left-large">
						<div class="feild-input" style="margin-bottom: 10px;">
							<label style="margin-right: 17px;">Tìm trong website</label>
							<h:inputText value="#{resultBean.webSiteSearch}"
								style="width:227px;"></h:inputText>
						</div>
						<div class="feild-input">
							<label style="margin-right: 10px;">Từ không muốn tìm</label>
							<h:inputText value="#{resultBean.notText}" style="width:227px;"></h:inputText>
						</div>
						<div class="feild-input"
							style="margin-top: 10px; margin-right: 28px;">
							<p:selectOneRadio value="#{resultBean.mode}" style="float:right;">
								<f:selectItem itemLabel="Tìm chính xác" itemValue="2"></f:selectItem>
								<f:selectItem itemLabel="Tìm bình thường" itemValue="1"></f:selectItem>
							</p:selectOneRadio>
						</div>
					</div>
				</div>
			</h:form>

		</div>

	</div>
	<div class="main" style="margin-top: 60px;">
		<h:panelGroup id="main_page">
			<div class="result_title">
				<h:outputText
					value="Tìm thấy #{resultBean.numberResult} kết quả trong #{resultBean.timeDuration} giây"></h:outputText>
			</div>
			<ui:repeat var="item" value="#{resultBean.resultList}">
				<div class="item">
					<div class="item_label">
						<h:outputLink value="#{item.vv101}" style="text-decoration:none;">
							<h:outputText value="#{item.vv102}"></h:outputText>
							<ui:remove>
								<h:outputText value="--------------------"></h:outputText>
								<h:outputText value="#{item.urlIndex}"></h:outputText>
							</ui:remove>
						</h:outputLink>
					</div>
					<div class="item_content">
						<h:outputText escape="false" value="#{item.subVV103}"></h:outputText>
					</div>
				</div>
			</ui:repeat>
			<h:panelGroup id="pagginggroup">
				<div class="pagingright">
					<div style="color: #266DB3; float: right;" class="page-element"></div>
				</div>
				<input type="hidden" value="#{resultBean.startpage}" id="start" />
				<input type="hidden" value="#{resultBean.endpage}" id="end" />
				<input type="hidden" value="#{resultBean.current}" id="current" />
				<input type="hidden" value="#{resultBean.totalpage}" id="page" />
				<input type="hidden" value="#{resultBean.totalrow}" id="row" />
			</h:panelGroup>
		</h:panelGroup>
	</div>
	<ui:include src="template/footer.xhtml"></ui:include>

</h:body>
</html>